package com.zhuojy.equity.mall.admin.web.controller.AttendanceControllers; /**
 * @className: AttendanceGroupController
 * @author: Csh
 * @date: 2024/3/19 21:33
 * @Version: 1.0
 * @description:
 */


import com.zhuojy.equity.mall.admin.common.entity.AttendanceGroup;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.AttendanceServices.AttendanceGroupService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("AttendanceGroup")
@Api(tags = "考勤组")
@RequiredArgsConstructor
public class AttendanceGroupController {
    @Autowired
    private AttendanceGroupService attendanceGroupService;

    /***
        * @Author Csh
        * @Description 分页调差
        * @Date 18:44 2024/4/10
        * @Param
        * @return
        **/

    @RequestMapping("findAll")
    ResultEntity findAll(@RequestBody AttendanceGroup attendanceGroup, @RequestParam(value = "pageSize",defaultValue = "100")Integer pageSize, @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum){
        return attendanceGroupService.findAll(attendanceGroup,pageNum,pageSize);
    }

    @RequestMapping("addOrUpAttendance")
    int addOrUpAttendance(@RequestBody AttendanceGroup attendanceGroup){
        return attendanceGroupService.addOrUpAttendance(attendanceGroup);
    }

    @RequestMapping("findOneAttendance")
    AttendanceGroup findOneAttendance(Integer id){
        return attendanceGroupService.findOneAttendance(id);
    }

    @RequestMapping("delAttendance")
    Integer delAttendance(@RequestBody AttendanceGroup attendanceGroup){
        return attendanceGroupService.delAttendance(attendanceGroup);
    }


}
